package com.itheima.test2;

import java.util.ArrayList;
import java.util.Collections;

public class Test {
    public static void main(String[] args) {
    /*
        有一个抽奖池：里面有两个奖箱子
        实现抽奖的代码
        */

        //设置奖池
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list, 50, 20, 30, 500, 400, 800, 900);

        //创建线程
        MyThread t1 = new MyThread(list);
        MyThread t2 = new MyThread(list);
        MyThread t3 = new MyThread(list);
        MyThread t4 = new MyThread(list);
        //设置名字
        t1.setName("抽奖箱1");
        t2.setName("抽奖箱2");
        t3.setName("抽奖箱3");
        t4.setName("抽奖箱4");
        //开启线程
        t1.start();
        t2.start();
        t3.start();
        t4.start();
    }
}
